$(function(){
		  type = sessionStorage['type'];
	      $("#addButton").bind("tap",function(){
	    	  //表单校验
	   	       var checked=$("#addressForm").check();
	   	       if(checked){
	                var formvalues=$("#addressForm").values();
	                formvalues['userId'] =sessionStorage['userId'];
	                Newtouch.Ajax.sendParams(formvalues,localStorage['APP_AJAX_PATH']+"/drinkingBar/view/addAddress.jsp.addAddress",function(){
	                	$(window).mobileMsgBox({msgText:"保存成功"});
	                	if(type == 1){
	                    window.location="addressManagement.html";
	                	}
	                	
	                	if(type == 2){
		                    window.location="chooseAddress.html";
		                	}
	                	
	                });
	   	   	    }
	       });
	      $("#city").mobileSelect({server:localStorage['APP_AJAX_PATH']+"/drinkingBar/view/addAddress.jsp.queryDictionaries",catalog:"Address"});

		
	});